# Copyright (c) 2025 Huawei Technologies Co., Ltd.
# This file is a part of the CANN Open Software.
# Licensed under CANN Open Software License Agreement Version 1.0 (the "License").
# Please refer to the License for details. You may not use this file except in compliance with the License.
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
# See LICENSE in the root of the software repository for the full text of the License.

curDirName=$(basename "$(pwd)")

deviceId=$1
targetName=$2
layoutA=0
layoutB=0
zeroPaddingM=$3
zeroPaddingN=$4
zeroPaddingK=$5
batchCount=$6
A100_40G_cublas_time_us=$7
ascblas_HgemmStrideBatched_time_us=$8

rm -rf batchgemm_batch_prof_result
cd ..
msprof op --application="./$targetName $deviceId $layoutA $layoutB $zeroPaddingM $zeroPaddingN $zeroPaddingK $batchCount" --launch-count=5 --output="./${curDirName}/batchgemm_batch_prof_result"
cd ${curDirName}
python3 ./prof.py $zeroPaddingM $zeroPaddingN $zeroPaddingK $batchCount $A100_40G_cublas_time_us $ascblas_HgemmStrideBatched_time_us
rm -rf batchgemm_batch_prof_result
